/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.com.seguridad;

import java.awt.event.ActionEvent;
import java.util.ResourceBundle;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import org.primefaces.context.RequestContext;
import co.com.controlador.util.JsfUtil;

import javax.servlet.http.HttpSession;

/**
 *
 * @author user
 */
@ManagedBean(name = "loginBean")
@SessionScoped
public class login {

    private String username;
    private String password;
    private String natillera;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNatillera() {
        return natillera;
    }

    public void setNatillera(String natillera) {
        this.natillera = natillera;
    }

    public String loginUsuario(ActionEvent actionEvent) {

        boolean result = true;
        if (result) {

            JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Propiedades").getString("login"));
            return "faces/menuAplicacion";
        } else {

            JsfUtil.addErrorMessage(ResourceBundle.getBundle("/Propiedades").getString("error"));
            return null;
        }

    }

}
